//
//  SuggestPageTableViewCell.m
//  wind
//
//  Created by dllo on 16/1/16.
//  Copyright © 2016年 李金明. All rights reserved.
//

#import "SuggestPageTableViewCell.h"

@implementation SuggestPageTableViewCell

- (void)dealloc
{
    [_songName release];
    [_singerName release];
    [_imageV release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createViews];
    }
    return self;
}

- (void)createViews
{
//    self.backgroundColor = [UIColor blueColor];

    self.imageV = [[UIImageView alloc] init];
//    self.imageV.backgroundColor = [UIColor blueColor];
    self.imageV.layer.masksToBounds = YES;
    self.imageV.layer.cornerRadius = 15;
    [self addSubview:self.imageV];
    [_imageV release];
    
    self.songName = [[UILabel alloc] init];
//    self.songName.backgroundColor = [UIColor yellowColor];
    self.songName.font = [UIFont boldSystemFontOfSize:26];
    self.songName.textColor = [UIColor whiteColor];
    self.songName.textAlignment = NSTextAlignmentCenter;
    [self.imageV addSubview:self.songName];
    [_songName release];
    
    self.singerName = [[UILabel alloc] init];
//    self.singerName.backgroundColor = [UIColor redColor];
    self.singerName.font = [UIFont boldSystemFontOfSize:22];
    self.singerName.textColor = [UIColor whiteColor];
    self.singerName.textAlignment = NSTextAlignmentCenter;
    [self.imageV addSubview:self.singerName];
    [_singerName release];
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self).with.offset(60);
        make.left.equalTo(self).with.offset(30);
        make.right.equalTo(self).with.offset(-30);
        make.bottom.equalTo(self).with.offset(-60);
        
    }];
    
    self.songName.frame = CGRectMake(50, 80, 250, 60);
    
    self.singerName.frame = CGRectMake(50, 180, 250, 40);
    
}

@end
